package com.lv.service.model

import com.lv.common.base.BaseViewModel
import com.lv.common.network.model.DataResult
import com.lv.common.utils.Constants
import com.lv.service.net.AddmultistageReqBody
import com.lv.service.net.CategoryPeriodsBody
import com.lv.service.net.ClientHFRReqBody
import com.lv.service.net.CompanyReqBody
import com.lv.service.net.CouponBody
import com.lv.service.net.CusCatetoryBody
import com.lv.service.net.CusTomerRecodeBody
import com.lv.service.net.DrawSetBody
import com.lv.service.net.LoginByCodeReqBody
import com.lv.service.net.LoginByPassWordReqBody
import com.lv.service.net.PutSpuBackdropReqBody
import com.lv.service.net.QuestionBody
import com.lv.service.net.SaveCashBody
import com.lv.service.net.SendCodeBody
import com.lv.service.net.UpdateProvinceComCardReqBody
import com.lv.service.net.UserDeleteReqBody
import com.lv.service.net.VerifyCodeBody
import com.lv.service.network.BaseYgxRsp
import okhttp3.MultipartBody
import okhttp3.RequestBody

/**
 * 作者： ygx
 * 创建日期：2023/2/28 5:09 PM
 * 签名： 天行健，君子以自强不息；地势坤，君子以厚德载物。
 * -    _              _           _     _   ____  _             _ _
 * -   / \   _ __   __| |_ __ ___ (_) __| | / ___|| |_ _   _  __| (_) ___
 * -  / _ \ | '_ \ / _` | '__/ _ \| |/ _` | \___ \| __| | | |/ _` | |/ _ \
 * - / ___ \| | | | (_| | | | (_) | | (_| |  ___) | |_| |_| | (_| | | (_) |
 * -/_/   \_\_| |_|\__,_|_|  \___/|_|\__,_| |____/ \__|\__,_|\__,_|_|\___/
 * <p>
 * You never know what you can do until you try !
 * ----------------------------------------------------------------
 * 描述：
 */
class ServiceViewModel(private val resource: IServiceResource) : BaseViewModel() {
    suspend fun login(body: LoginByPassWordReqBody): DataResult<BaseYgxRsp> = resource.login(body)

    suspend fun loginByCode(body: LoginByCodeReqBody): DataResult<BaseYgxRsp> =
        resource.loginByCode(body)

    suspend fun latestUser() = resource.latestUser()

    suspend fun findPros(map: Map<String, String>) = resource.findPros(map)

    /**
     * 发送短信验证
     */
    suspend fun sendCode(body: SendCodeBody) = resource.sendCode(body)

    /**
     * 验证验证码
     */
    suspend fun verifyCode(body: VerifyCodeBody) = resource.verifyCode(body)

    /**
     * 意见反馈
     */
    suspend fun feedback(text: String): DataResult<BaseYgxRsp> = resource.feedback(text)

    /**
     * 修改个人信息
     */
    suspend fun updateMyLogo(
        map: Map<String, RequestBody>, part: List<MultipartBody.Part>
    ): DataResult<BaseYgxRsp> = resource.updateMyLogo(map, part)

    /**
     * 修改个人信息
     */
    suspend fun updateMyMessage(body: Map<String, RequestBody>): DataResult<BaseYgxRsp> =
        resource.updateMyMessage(body)

    /**
     * 发送短信验证-修改公司
     */
    suspend fun sendCodeCom(body: SendCodeBody) = resource.sendCodeCom(body)

    /**
     * 验证验证码-修改公司
     */
    suspend fun verifyCodeCom(body: VerifyCodeBody) = resource.verifyCodeCom(body)

    /**
     * 注销个人信息
     */
    suspend fun deleteUser(body: UserDeleteReqBody): DataResult<BaseYgxRsp> =
        resource.deleteUser(body)

    /**
     * 修改个人信息-业务员修改公司
     */
    suspend fun updatePasswordOrPhone(body: CompanyReqBody): DataResult<BaseYgxRsp> = resource.updatePasswordOrPhone(body)



    /**
     * 查找个数
     */
    suspend fun findCount(map: Map<String, String>) = resource.findCount(map)



    /**
     * 查找单个期数
     */
    suspend fun findOnePdAndCa(map: Map<String, String>): DataResult<BaseYgxRsp> =
        resource.findOnePdAndCa(map)


    /**
     *  查看小程序或进件信息
     */
    suspend fun findOneSubmit(map: Map<String, String>): DataResult<BaseYgxRsp> =
        resource.findOneSubmit(map)

    /**
     *  亨富然基础信息
     */
    suspend fun findhengPros(map: Map<String, String>): DataResult<BaseYgxRsp> =
        resource.findhengPros(map)

    /**
     * 亨富然开户
     */
    suspend fun saveHengCompany(body: ClientHFRReqBody): DataResult<BaseYgxRsp> = resource.saveHengCompany(body)
}